<?php
class Arm_Controller_Action_Helper_CliView extends Zend_Controller_Action_Helper_Abstract
{
	/**
	 * Рестер Arm_Acl для модулей.
	 * @var array
	 */
	private static $_register = array();
	
	

   /**
     * Hook into action controller preDispatch() workflow
     *
     * @return void
     */
    public function preDispatch()
    {
        $request = $this->_actionController->getRequest();
    	$module  = $request->getModuleName();
    	$controller = $request->getControllerName();
    	$action     = $request->getActionName();
    	
    	$pathModule   = Arm_Core::getPathModule($module);
    	$pathLayout   = Arm_Core::getPathLayouts() . 'cli' . DIRECTORY_SEPARATOR; 
        $viewRenderer = Zend_Controller_Action_HelperBroker::getStaticHelper('ViewRenderer');
        $view = $viewRenderer->view;
        
        $view->setScriptPath($pathModule . 'scripts/');
        // устновка пощников и фильтров Zend
        $view->setHelperPath('Zend/View/Helper/', 'Zend_View_Helper_');
        $view->setFilterPath( 'Zend/View/Filter/', 'Zend_View_Filter_');
        // Arm
        $view->addFilterPath(Arm_Core::getPathLibrary() . 'Arm/View/Filter/', 'Arm_View_Filter_');
        $view->addHelperPath(Arm_Core::getPathLibrary() . 'Arm/View/Helper/', 'Arm_View_Helper_');
        // Тема
        $view->addFilterPath($pathLayout . 'filters/', 'Layoyt_View_Filter_');
        $view->addHelperPath($pathLayout . 'helpers/', 'Layoyt_View_Helper_');
        // Модуля
        $view->addFilterPath($pathModule . 'filters/', ucfirst($module) . '_View_Filter_');
        $view->addHelperPath($pathModule . 'helpers/', ucfirst($module) . '_View_Helper_');
        $viewRenderer->setView($view);
        return;
    }
    
    

}